package com.example.job;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;

@Slf4j
@com.example.job.annotation.Job(name = "测试任务", cron = "*/10 * * * * ?", available = true)
public class TestJob implements Job {

    private SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("======execute,当前时间:" + simpleDateFormat.format(new Date()));
    }

}
